Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Browse style options

This section offers a few ideas for changing the look of your browse.

Using stacked labels

To use more than one line for your column labels, use the stacked label syntax. Here is an example:

DEFINE BROWSE CustBrowse QUERY CustQuery DISPLAY  
  CustNum COLUMN-LABEL "Customer!Number" 
  Name COLUMN-LABEL "Customer!Name" WITH 10 DOWN. 

You must use the COLUMN-LABEL option instead of the LABEL option. The exclamation point character indicates the line breaks.

Justifying labels

Column labels in the browse are left-justified by default. You can use the C, L, and R options (Center, Left, Right) of the LABEL attribute to modify the justification of column labels:

DEFINE BROWSE CustBrowse QUERY CustQuery DISPLAY  
  CustNum LABEL "Cust. No.":C  
  Name WITH 10 DOWN. 

Note the colon (:) syntax. To use this option, you must attach the justification option to the end of the LABEL option. So, even if you want to use the default labels, you need to re-enter them here in order to append the justification option.

Using color to distinguish updateable columns

You can make the updateable columns in your browse a different color. For example, you can make the read-only columns gray with black text and the updateable columns blue with yellow text. This code fragment assumes you defined variables to hold the standard color values:

ASSIGN CustNum:COLUMN-BGCOLOR IN BROWSE CustBrowse = gray-color 
       CustNum:COLUMN-FGCOLOR IN BROWSE CustBrowse = black-color 
       Name:COLUMN-BGCOLOR IN BROWSE CustBrowse = blue-color 
       Name:COLUMN-FGCOLOR IN BROWSE CustBrowse = yellow-color. 

Note: In character interfaces, the COLUMN-DCOLOR attribute specifies the column color.

Using color and font to distinguish cells

On top of your basic color scheme, you may want individual cells that have key values to display in a different color or font. For example, you might want to color overdue accounts in red. This kind of cell manipulation is only valid while the cell is in the viewport. For this reason, you need to use the special ROW-DISPLAY event to check each new row as it is scrolled into the viewport. See the "Browse events" section for examples and implementation notes.

Establishing ToolTip information

The DEFINE BROWSE statement supports the TOOLTIP option. You can elect to specify a ToolTip, a brief text message string that automatically displays when the mouse pointer pauses over a browse widget for which a ToolTip value is defined. You can set a ToolTip value for a variety of field-level widgets. However, they are most commonly defined for button widgets.

Using a disabled updateable browse as a read-only browse

A browse with no enabled columns is considered a read-only browse. A read-only browse has certain limitations that you might want to circumvent by defining one or more enabled columns in the browse definition. You then disable those columns at run time by setting their READ-ONLY attribute to TRUE. Using an updateable browse that has had its enabled columns turned off by way of the READ-ONLY attribute provides these benefits:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095